#Include 'Protheus.ch'

User Function TstDTLst()

	local	cLote		:=	""
	local cMostra		:=	""
	local	aLst		:=	popula()
	local	nX			:=	0

	asort(aLst)
	cLote	:=	separa(aLst[1],";",.T.)[1]

	for nX := 1 to len(aLst) step 1

		if aLst[nX] == cLote
		
			cMostra	+= strZero(nX,2) + " - " + aLst[nX] + chr(13) + chr(10)

		endif

		if (aLst[nX] # cLote) .OR. (nX == len(aLst))

			ApMsgInfo(cMostra,"Lista do Lote")
			cLote		:=	aLst[nX]
			cMostra	:=	strZero(nX,2) + " - " + aLst[nX] + chr(13) + chr(10)

		endif

	next

	Return nil

static function popula()

	local aRet := {}

	aadd(aRet,"20130220")
	aadd(aRet,"20130224")
	aadd(aRet,"20130214")
	aadd(aRet,"20130212")
	aadd(aRet,"20130222")
	aadd(aRet,"20130201")
	aadd(aRet,"20130218")
	aadd(aRet,"20130225")
	aadd(aRet,"20130226")
	aadd(aRet,"20130212")
	aadd(aRet,"20130211")
	aadd(aRet,"20130210")
	aadd(aRet,"20130227")
	aadd(aRet,"20130217")
	aadd(aRet,"20130220")
	aadd(aRet,"20130203")
	aadd(aRet,"20130217")
	aadd(aRet,"20130203")
	aadd(aRet,"20130217")
	aadd(aRet,"20130212")
	aadd(aRet,"20130220")
	aadd(aRet,"20130212")
	aadd(aRet,"20130212")
	aadd(aRet,"20130228")
	aadd(aRet,"20130223")
	aadd(aRet,"20130203")
	aadd(aRet,"20130213")
	aadd(aRet,"20130204")
	aadd(aRet,"20130211")
	aadd(aRet,"20130218")
	aadd(aRet,"20130218")
	aadd(aRet,"20130228")
	aadd(aRet,"20130223")
	aadd(aRet,"20130202")
	aadd(aRet,"20130212")
	aadd(aRet,"20130217")
	aadd(aRet,"20130202")
	aadd(aRet,"20130221")
	aadd(aRet,"20130208")
	aadd(aRet,"20130217")
	aadd(aRet,"20130220")
	aadd(aRet,"20130220")
	aadd(aRet,"20130228")
	aadd(aRet,"20130203")
	aadd(aRet,"20130228")
	aadd(aRet,"20130222")
	aadd(aRet,"20130228")
	aadd(aRet,"20130219")
	aadd(aRet,"20130218")
	aadd(aRet,"20130205")

	return aRet
